Page({
  getUserInfo: function () {
    wx.login({
      success: function (res) {
        console.log(res)
        // 如果用户拒绝了申请权限授权框
        // 则下次申请权限，也不会弹出授权框
        wx.getUserInfo({
          withCredentials: false,
          success: function (res) {
            console.log(res);
          },
          fail: function (res) {
            console.log(res)
          }
        })
      }
    })
  },
  checkSession: function() {
    wx.checkSession({
      success: function() {
        console.log('success')
      },
      fail:function() {
        console.log("fail")
      }
    })
  },
  openSetting:function() {
    wx.openSetting({
      success:function() {
        console.log("授权成功！")
      }
    })
  },
  onUnload: function () {
    console.log("onUnload")
  },
  onHide: function () {
    console.log("onHide")
  }
})